<template>
  <div id="app">
    <router-view/>
    <BottomBar v-show="show"></BottomBar>
  </div>
</template>
<script>
import BottomBar from '@/components/BottomBar.vue'
export default {
  components: {
    BottomBar
  },
  data () {
    return {
      show: false
    }
  },
  updated () {
    // console.log('this.$route :', this.$route.path)
    if (this.$route.path === '/home' ||
        this.$route.path === '/me' ||
        this.$route.path === '/train' ||
        this.$route.path === '/share' ||
        this.$route.path === '/club') {
      this.show = true
    } else {
      this.show = false
    }
    if (this.$route.path === '/login' || this.$route.path === '/') {
    } else {
      if (!sessionStorage.sessionid) {
        this.$root.$router.replace('/')
      }
    }
  },
  created () {
    if (!sessionStorage.sessionid) {
      this.$root.$router.replace('/')
    }
  }
}
</script>
<style>
</style>
